package br.org.ifrr.controller;

import java.io.Serializable;
import java.util.List;

import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;

import br.org.ifrr.model.Gestor;
import br.org.ifrr.model.Material;
import br.org.ifrr.repository.Materias;
import br.org.ifrr.repository.filter.MateriaFilter;

@Named
@ViewScoped
public class PesquisaMaterialBean implements Serializable {

	private static final long serialVersionUID = 1L;

	@Inject
	private Materias materias;

	private Material material;

	private Gestor gestor;

	private MateriaFilter filtro;

	private List<Material> materialFiltrados;

	private Material materialSelecionado;

	public PesquisaMaterialBean() {
		filtro = new MateriaFilter();
	}

	public void pesquisar() {
		materialFiltrados = materias.filtrados(filtro);
	}

	public Material getMaterial() {
		return material;
	}

	public void setMaterial(Material material) {
		this.material = material;
	}

	public Material getMaterialSelecionado() {
		return materialSelecionado;
	}

	public void setMaterialSelecionado(Material materialSelecionado) {
		this.materialSelecionado = materialSelecionado;
	}

	public MateriaFilter getFiltro() {
		return filtro;
	}

	public List<Material> getMaterialFiltrados() {
		return materialFiltrados;
	}

	public Gestor getGestor() {
		return gestor;
	}

}
